package com.wx.chapter11.enum_;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/13 - 16:52
 */
public class EnumExercise02 {
    public static void main(String[] args) {
        Week[] values = Week.values();
        System.out.println("===所有星期的信息如下===");
        for (Week value : values) {
            System.out.println(value);
        }
    }
}

enum Week {
    //定义枚举对象
    MONDAY("星期一"), TUESDAY("星期二"), WEDNESDAY("星期三"),
    THURSDAY("星期四"), FRIDAY("星期五"), SATURDAY("星期六"), SUNDAY("星期日");
    private String name;

    Week(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name;
    }
}